home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-09-17 | 3.5 KB | 123 lines | [TEXT/MPS ] |
- ;
- ; File: UVUAssist.a - MacApp 3.0 compatible version
- ;
- ; Contains: hook VU assistance proc for the mole to call (glue routine for Object Pascal
- ; method MoleAssist)
- ;
- ; Written by: David Shayer
- ;
- ; Copyright: © 1991-92 by Apple Computer, Inc., all rights reserved.
- ;
- ; Version: 1.0a1
- ;
- ; Change History (most recent first):
- ;
- ; 2/13/92 JAS indicate 3.0 compatibility, change version
- ; 1/27/92 JAS indicate 3.0b4 compatibility, change version
- ; 10/4/91 JAS indicate 3.0b2 compatibility, change version
- ; 9/10/91 JAS indicate 3.0b2PQR compatibility, change version
- ; 8/21/91 JAS change version
- ; 8/13/91 JAS change ObjectIntf for TVUAssist to include
- ; fGridItemSupport data member
- ; 8/13/91 JAS set CASE to OBJ
- ; 8/13/91 JAS include ObjectIntf for TEvtHandler
- ;
-
- CASE OBJ
- INCLUDE 'ObjMacros.a'
- INCLUDE 'SysEqu.a'
- BLANKS ON
-
- ; Historical Note: References to the "Mole" are equivalent to references to
- ; "Agent VU". "Agent VU" was previously called the "Mole".
- ;
- ; FUNCTION MoleHook (Select :integer; Input :Ptr; VAR OutputSize :integer;
- ; Result :integer) :OSErr; C;
- ;
- ; This is a glue routine. It is called by the mole, with a C interface.
- ; It calls TVUAssist.MoleAssist with a Pascal interface. It passes the
- ; same parameters on, it just glues the C and Pascal interfaces together.
- ;
- ; stack frame on entry (after LINK):
- ; +-------------------+
- ; | Result |
- ; +-------------------+ <-- 18(A6)
- ; | *OutputSize |
- ; +-------------------+ <-- 14(A6)
- ; | Output |
- ; +-------------------+ <-- 10(A6)
- ; | Input |
- ; +-------------------+ <-- C(A6)
- ; | Select |
- ; +-------------------+ <-- 8(A6)
- ; | Return Address |
- ; +-------------------+ <-- 4(A6)
- ; | Old A6 |
- ; +-------------------+ <-- A6
- ;
- ; stack for call to TVUAssist.MoleAssist (at MethCall):
- ; +-------------------+
- ; | Return Value |
- ; +-------------------+
- ; | Select |
- ; +-------------------+
- ; | Input |
- ; +-------------------+
- ; | *OutputSize |
- ; +-------------------+
- ; | Result |
- ; +-------------------+
- ; | Object Handle |
- ; +-------------------+ <-- A7
- ;
- ; TVUAssist.MoleAssist will remove all parameters, leaving the return value
- ; on the top of the stack.
- ; The mole expects the return value in D0. The mole will remove the parameters
- ; it originally placed on the stack.
- ;
-
- Seg 'Main'
-
- ; Abridged object definition for TEventHandler
- ObjectIntf TEventHandler, TObject, \
- (fIdleFreq,4), \
- (fLastIdle,4), \
- (fNextHandler,4)
-
- ; Abridged object definition for TVUASSIST
- ObjectIntf TVUASSIST, TEventHandler, \
- (FMOLEREFNUM,2), \
- (GRIDITEMSUPPORT,1), \
- METHODS, \
- (IVUASSIST), \
- (OPENMOLEDRIVER), \
- (SUSPENDMOLE), \
- (RESUMEMOLE), \
- (SETDEBUGGERHOOK), \
- (MOLEASSIST)
-
-
- MoleHook PROC EXPORT
- IMPORT gVUAssist:DATA ;global pointer to VUAssist
- LINK A6, #$0 ;set up stack frame
- MOVE.L A5, -(A7) ;save a5
- MOVE.L CurrentA5, A5 ;get application's A5
- CLR.W -(A7) ;make space for return result
- MOVE.W $A(A6), -(A7) ;push Select (load lo word)
- MOVE.L $C(A6), -(A7) ;push Input
- MOVE.L $10(A6), -(A7) ;push Output
- MOVE.L $14(A6), -(A7) ;push OutputSize
- MOVE.W $1A(A6), -(A7) ;push Result (load lo word)
- MOVE.L gVUAssist(A5),-(A7) ;push object handle, which will become "Self"
- MethCall MOLEASSIST,TVUASSIST;call TVUAssist.MoleAssist
- MOVE.W (A7)+, D0 ;pop return result
- EXT.L D0 ;make return result a longword
- MOVE.L (A7)+, A5 ;restore A5
- UNLK A6 ;tear down stack frame
- RTS ;return
- DC.B 'MOLEHOOK' ;Macsbug name
- ENDPROC
-
-
- END
-